<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStaffTable extends Migration
{
  /**
   * 内部员工
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('staff', function (Blueprint $table) {
      $table->increments('id');
      $table->string('name', 30)->comment('姓名');
      $table->boolean('sex')->default(true)->comment('性别 1男 2女');
      $table->string('tel', 20)->comment('联系电话');
      $table->string('address', 255)->comment('联系地址');
      $table->string('card', 20)->comment('省份证号');
      $table->string('birthday', 30)->comment('生日');
      $table->string('entry_time', 30)->comment('入职时间');
      $table->unsignedSmallInteger('role_id')->comment('部门ID');
      $table->unsignedSmallInteger('profession_id')->comment('工种ID');
      $table->boolean('is_dimission')->default(false)->comment('是否离职 1已离职 0未离职');
      $table->string('dimission_time', 30)->nullable()->comment('离职时间');
      $table->text('dimission_msg')->nullable()->comment('离职原因');
      $table->timestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('staff');
  }
}
